<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // 给参数添加默认值，有默认值的通常放在最后
    function add(a, b, c = 5) {
        return a + b + c;
    }
    add(1, 2);

    function connect({ host, username, password }) {
        console.log(host, username, password);
    }
    connect({ host: 'localhost', username: 'root', password: '123456' });

</script>

</html>